/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package station3d.graphics;

import com.sun.opengl.util.texture.Texture;
import station3d.math.*;

/**
 *
 * @author Martin
 */
public class Terrain {

    private final Mesh terrainMesh;
    private final Vector3D position = new Vector3D();

    private final float meshScale;

    private Texture largeTexture;
    private Texture detailTexture;

    /**
     * Vytvoří nový terén se zadaným meshem.
     * @param terrainMesh mesh terénu.
     */
    public Terrain(Mesh terrainMesh, float meshScale) {
        this.terrainMesh = terrainMesh;
        this.meshScale = meshScale;
    }


    public void dispose() {
        if (largeTexture != null) largeTexture.dispose();
        if (detailTexture != null) detailTexture.dispose();
        terrainMesh.dispose();
    }

    public Mesh getTerrainMesh() {
        return terrainMesh;
    }

    public float getMeshScale() {
        return meshScale;
    }

    public Vector3D getPosition() {
        return position;
    }

    public void setPosition(Vector3D position) {
        this.position.setTo(position);
    }

    public Texture getLargeTexture() {
        return largeTexture;
    }

    public void setLargeTexture(Texture largeTexture) {
        this.largeTexture = largeTexture;
    }

    public Texture getDetailTexture() {
        return detailTexture;
    }

    public void setDetailTexture(Texture detailTexture) {
        this.detailTexture = detailTexture;
    }

}
